package cc.jq1024.infrastructure.persistent.dao;

import cc.jq1024.infrastructure.persistent.po.UserRaffleOrderPO;
import cc.jq1024.router.annotation.DBRouter;
import cc.jq1024.router.annotation.DBRouterStrategy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * 用户抽奖订单表 Mapper 接口
 * </p>
 *
 * @author lijiaqiang@ljq1024.cc
 * @since 2024-04-28
 */
@Mapper
@DBRouterStrategy(splitTable = true)
public interface IUserRaffleOrderDao extends BaseMapper<UserRaffleOrderPO> {

    /** 插入用户抽奖订单 */
    void insertOne(UserRaffleOrderPO userRaffleOrderPO);

    /** 查询没有被使用的活动抽奖订单 */
    @DBRouter
    UserRaffleOrderPO queryNoUsedRaffleOrder(UserRaffleOrderPO userRaffleOrderReq);

    /** 更新抽奖单 */
    int updateUserRaffleOrderStateUsed(UserRaffleOrderPO userRaffleOrderReq);
}
